package com.example.xm.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.example.xm.entity.Udaan;
import com.example.xm.service.IUdaanService;
import com.example.xm.web.Result;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 【请填写功能名称】Controller
 * 
 * @author ruoyi
 * @date 2025-02-14
 */
@RestController
@RequestMapping("/system/udaan")
public class UdaanController
{
    @Autowired
    private IUdaanService udaanService;

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public Result list(Udaan udaan)
    {
        List<Udaan> list = udaanService.selectUdaanList(udaan);
        return Result.success(list);
    }



    /**
     * 获取【请填写功能名称】详细信息
     */
    @GetMapping(value = "/{id}")
    public Result getInfo(@PathVariable("id") Long id)
    {
        return Result.success(udaanService.selectUdaanById(id));
    }
    @PostMapping("/add")
    public Result add(@RequestBody List<Udaan> udaans)
    {
        return Result.success(udaanService.insertUdaan(udaans));
    }

    @PutMapping
    public Result edit(@RequestBody Udaan udaan)
    {
        return Result.success(udaanService.updateUdaan(udaan));
    }

	@DeleteMapping("/{ids}")
    public Result remove(@PathVariable Long[] ids)
    {
        return Result.success(udaanService.deleteUdaanByIds(ids));
    }
}
